<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>湖南大学教育阳光服务网上大厅</title>
  <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="css/common.css" rel="stylesheet">
  <link href="css/index.css" rel="stylesheet">
</head>

<body>
  <header>
    <img src="img/head_title.png" alt="logo" class="logo">
    <ul>
      <li>
        <i class="fa fa-book"></i>
        <h3>办事指南</h3>
        <a href="http://hdsw.hnu.edu.cn/">点击进入</a>
      </li>
      <li>
        <i class="fa fa-bank"></i>
        <h3>政策咨询</h3>
        <a href="./module/form.consulting.html">点击进入</a>
      </li>
      <li>
        <i class="fa fa-envelope"></i>
        <h3>信息公开</h3>
        <a href="http://xxgk.hnu.edu.cn/">点击进入</a>
      </li>
      <li>
        <i class="fa fa-commenting"></i>
        <h3>投诉受理</h3>
        <a href="./module/form.complaints.html">点击进入</a>
      </li>
      <li>
        <i class="fa fa-users"></i>
        <h3>舆情回应</h3>
        <a href="./module/form.feedback.html">点击进入</a>
      </li>
    </ul>
  </header>
  <nav>
    <div>
      <ul>
        <li>
          <a href="http://www.hnu.edu.cn/">湖南大学</a>
        </li>
        <li>
          <a href="http://fuwu.hnedu.cn">湖南省教育阳光服务平台</a>
        </li>
      </ul>
    </div>
  </nav>
  <article id="main">
    <section id="leftsection">
      <div class="question">
        <h2>
            <a class="seemore" href="./module/page.list.html?t=HOTQUESTION">查看更多&gt;&gt;</a>
          常见问题
        </h2>
        <ul id="questionList" class="list">

        </ul>
      </div>
      <div>
        <h2>统计及公布
          <span class="search">
            <input type="text" placeholder="请输入受理编号">
            <i class="fa fa-search"></i>
          </span>
        </h2>
        <div id="tablescroll">
          <table id="publishTable" class="publish">
            <tbody>

            </tbody>
          </table>
        </div>
        <p class="count">累计受理：
          <span id="sumSpan">0</span> 已经解决：
          <span id="endSpan">0</span>
        </p>
      </div>
    </section>
    <section id="rightsection">
      <div>
        <h2>
          <a class="seemore" href="./module/page.list.html?t=MOMENT">查看更多&gt;&gt;</a>
          工作动态
        </h2>
        <ul id="momentList" class="list">

        </ul>
      </div>
      <div>
        <h2>
          <a class="seemore" href="./module/page.list.html?t=PRAISE">查看更多&gt;&gt;</a>
          群众表扬
        </h2>

        <ul id="praiseList" class="list">
        </ul>
      </div>
      <div class="operation">
        <h2>用户操作</h2>
        <ul>
          <li>
            <a href="./module/form.praise.html">我要表扬</a>
          </li>
          <li>
            <a href="./module/form.suggest.html">我要建议</a>
          </li>
          <li>
            <a href="./module/form.complaints.html">我要投诉</a>
          </li>
          <li>
            <a href="./module/form.consulting.html">我要咨询</a>
          </li>
        </ul>
      </div>
    </section>
  </article>
  <footer>
    CopyRight&copy;版权所有
  </footer>
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/handlebars.js/4.0.10/handlebars.min.js"></script>
  <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
  <script src="./HOST.js"></script>
  <script src="./xss.js"></script>
  <script>
    $.ajax({
        url: Host + "/api/count",
      type: "get",
      data: null,
      success: function (msg, data) {
        jQuery("#sumSpan").text(msg.sum);
        jQuery("#endSpan").text(msg.end);
      }
    });
    $.ajax({
        url: Host + "/api/information/public",
      type: "get",
      data: null,
      success: function (msg, data) {
          var urlHead = './module/page.information.html?id=';
        msg.data.forEach(function (e) {
          var item = '';
          var date = new Date(e.created_date).toLocaleDateString();
          e.title = filterXSS(e.title);
          item += '<tr>' +
            '<td>' + e.id + '</td>' +
            '<td><a href=\"' + urlHead + e.id + '\">' + e.title + '</a></td>' +
            '<td>' + date + '</td>' +
            '<td>' + getStatus(e.status) + '</td>' +
            '</tr>';
          jQuery("#publishTable").append(item);
        });
      }
    });
    $.ajax({
        url: Host + "/api/article/hotQuestion/preview",
      type: "get",
      data: null,
      success: function (msg, data) {
          var urlHead = Host + '/module/page.article.html?id=';
        msg.data.forEach(function (e) {
          var item = '';
          item += '<li>' +
            '<a href=\"' + urlHead + e.id + '\"' + '>' + e.title + '</a>' +
            '</li>';
          // herf = module/page.article.html?id=e.id
          jQuery("#questionList").append(item);
        });
      }
    });
    $.ajax({
        url: Host + "/api/article/moment/preview",
      type: "get",
      data: null,
      success: function (msg, data) {
          var urlHead = Host + '/module/page.article.html?id=';
        msg.data.forEach(function (e) {
          var item = '';
          item += '<li>' +
            '<a href=\"' + urlHead + e.id + '\"' + '>' + e.title + '</a>' +
            '</li>';
          jQuery("#momentList").append(item);
        });
      }
    });
    $.ajax({
        url: Host + "/api/information/praise/preview",
      type: "get",
      data: null,
      success: function (msg, data) {
          var urlHead = './module/page.information.html?id=';
        msg.data.forEach(function (e) {
            e.title = filterXSS(e.title);
          var item = '';
          item += '<li>' +
            '<a href=\"' + urlHead + e.id + '\"' + '>' + e.title + '</a>' +
            '</li>';
          jQuery("#praiseList").append(item);
        });
      }
    });

  </script>
</body>

</html>